package data.dictionary;

import java.util.ArrayList;

import data.set.OfflineSetIterator;

public class Dictionary_Memory_FilterRareWord<T> extends Dictionary_Memory<T>{
	
	private ArrayList<Integer> occurence = new ArrayList<Integer>();
	


	/* (non-Javadoc)
	 * @see data.dictionary.Dictionary_Memory#addValue(java.lang.Object)
	 */
	@Override
	public void addValue(T x) {
		int index = super.indexOf(x); 
		
		if(index == -1){		
			super.addValue(x);
			occurence.add(1);
		}
		else{
			occurence.set(index,occurence.get(index)+1);
		}
	}


	public int getOccurence(int index){
		return occurence.get(index);
	}
	

}
